package com.ruoyi.house.mapper.dao;

import com.ruoyi.house.domain.RoomImageEntity;
import com.ruoyi.house.domain.RoomInfoEntity;
import com.ruoyi.house.domain.RoomInfoSonEntity;
import com.ruoyi.house.dto.IdNamePair;
import com.ruoyi.house.dto.QueryRoomInfoResponseDto;
import com.ruoyi.house.dto.request.RequestDetailRoomInfoDto;
import com.ruoyi.house.dto.request.RequestSearchRoomsDto;
import com.ruoyi.house.dto.response.ResponseDetailRoomInfoDto;
import com.ruoyi.house.dto.response.ResponseSearchRoomsDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 房源信息表
 * 
 * @author LZJ
 * @email LZJ@wish.com
 * @date 2018-02-11 17:08:31
 */
@Mapper
public interface RoomInfoDao extends BaseDao<RoomInfoEntity> {
	
public List<String> queryPic(String houseId);
	
	public void savePic(RoomImageEntity image);
	
	public void deletePic(String id);

	public void deleteByHouse(String houseId);

    /**
     * 查询房源商户列表
     * @return list
     * @param map
     */
	List<RoomInfoEntity> queryListByBusiness(Map<String, Object> map);

    void deletePictureByRoomId(String[] id);

    void deleteReservationByRoomId(String[] id);

    RoomInfoEntity queryObjectById(String id);

    List<RoomInfoSonEntity> queryRoomInfoByHouseId(String houseId);

	public void inserCentralLizedRoom(RoomInfoEntity roomInfo);

	int queryListTotal(Map<String, Object> map);

	public List<RoomInfoEntity> getRoomListByHouseId(String houseId);

	public void updateCentralLizedRoom(RoomInfoEntity roomInfo);
	public void delPictureByRoomId(String roomId);

	public void deleteRoomsByHouseId(String houseId);

	public void recommendedRooms(String id);

	public void delCentralLizedRoomPicByHouseId(String houseId);

	public List<String> getHouseImageByHouseId(String houseId);
	
	public ResponseDetailRoomInfoDto detailRoomInfo(RequestDetailRoomInfoDto requestDetailRoomInfoDto);

	public List<ResponseSearchRoomsDto> searchRooms(RequestSearchRoomsDto requestSearchRooms);
	
	RoomInfoEntity findById(Map<String,Object>param);

	/**
	 * 
	 * @Description: 根据es更新前后时间进行查询房源信息
	 * @param map
	 * @return List<QueryRoomInfoResponseDto>
	 */
	public List<QueryRoomInfoResponseDto> queryRoomInfoList(HashMap<String, Object> map);
	
	/**
	 * 
	 * @Description: 根据es更新前后时间进行查询房产信息
	 * @param map
	 * @return List<QueryRoomInfoResponseDto>
	 */
	public List<QueryRoomInfoResponseDto> queryHouseInfoList(HashMap<String, Object> map);
	
	/**
	 * 
	 * @Description: 根据es更新前后时间进行查询楼盘信息
	 * @param map
	 * @return List<QueryRoomInfoResponseDto>
	 */
	public List<QueryRoomInfoResponseDto> queryPremisesInfoList(HashMap<String, Object> map);

	/**
	 * 
	 * @Description: 根据地铁id查询地铁名及id
	 * @param string
	 * @return IdNamePair<Integer,String>
	 */
	public IdNamePair<Integer, String> getSubWayByIdList(Integer string);

	public List<IdNamePair<Integer, String>>  getSubWayByIdListByIds(@Param("subWayIds") Set subWayIds);
	
	/**
	 * 
	 * @Description: 根据商圈id查询地铁名及id
	 * @return IdNamePair<Integer,String>
	 */
	public IdNamePair<Integer, String> getBusinessCircleByIdList(String businessCircle);
	
	/**
	 * 
	 * @Description: 查询房源总条数
	 * @return int
	 */
	int queryRoomInfoTotal();

	public void qxRecommendedRooms(String ids);

	public int findRoomInfo(Integer businessId);

	public List<RoomInfoEntity> findRental(String format3, String format2, int type, Integer businessId);

	public int findRoomCountSf(int type, Integer businessId, String format1, String format2);

	public int findRoomCount(int type, Integer businessId, Integer status, String endTime, String startTime,
			String time);
}
